#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date    : 2018-03-15 15:34:44


from url import url
import tornado.web
import os
try:
    import ConfigParser
except ModuleNotFoundError:
    import configparser as ConfigParser


config_file = os.path.join(os.path.dirname(__file__), "conf", "server.ini")
cfg = ConfigParser.ConfigParser()
cfg.read(config_file)
settings = dict(
    template_path=os.path.join(os.path.dirname(
        __file__), cfg.get('app', 'template_path')),
    static_path=os.path.join(os.path.dirname(
        __file__), cfg.get('app', 'static_path'))
)

app = tornado.web.Application(
    handlers=url,
    **settings
)
